#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int secondHighest(string s) {
        s += 'a';
        sort(s.begin(), s.end());
        int it = s.find('a') - 2;
        for (it; it >= 0; --it)
        {
            if (s[it] < s[it + 1])
                return s[it] - 48;
        }

        return -1;
    }
};